﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BLL;
using System.Data;
using System.IO;
using System.Drawing;
public partial class administrator_uc_admin_a_supportonline : WebPageSecurity
{
    protected void Page_Load(object sender, EventArgs e)
    {
        
    }   
    protected void lbtAddNewItem_Click(object sender, EventArgs e)
    {
        try
        {
            new CmsBLL().SupportOnline_InsertItem(txtDescription.Text, txtFullName.Text, txtAddress.Text, txtEmail.Text, txtPhoneNumber.Text, txtYahoo.Text, int.Parse("0" + txtSortIndex.Text.Trim()), int.Parse("0" + rdActive.SelectedValue));
            lblMessage.Text = "Thêm mới thành công!";         
            ResetForm();
        }
        catch (Exception ex)
        {
            lblMessage.Text = "ERROR! " + ex.Message.ToString();
        }
    }
    private void ResetForm()
    {
        txtDescription.Text = "";
        txtFullName.Text = "";
        txtAddress.Text = "";
        txtEmail.Text = "";
        txtPhoneNumber.Text = "";
        txtYahoo.Text = "";
        txtSortIndex.Text = "";    
        rdActive.SelectedValue = "1";
        txtDescription.Focus();
    }
}